home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / C / Comet2.1.3.cpt / include / telnet.h < prev    next >
Text File  |  1991-03-28  |  3KB  |  152 lines

  1. /*  Copyright 1984 by the Massachusetts Institute of Technology  */
  2. /*
  3.     Copyright Cornell University 1986.  All rights are reserved.
  4.  
  5.     See notice.h
  6. */
  7.  
  8. /* Definitions for telnet */
  9.  
  10. struct ucb {
  11.     int    u_state;    /* ESTAB or CLOSING */
  12.     int    u_tcpfull;    /* is tcp's output buffer full? */
  13.     int    u_tftp;        /* tftp acceptance */
  14.     int    u_rstate;    /* Read terminal state */
  15.                 /* NORMALMODE */
  16.                 /* BLOCK - don't read terminal */
  17.     int    u_rspecial;    /* Read terminal character handling */
  18.                 /* NORMALMODE */
  19.                 /* SPECIAL - processing char after prompt */
  20.                 /* CONFIRM - quit confirmation */
  21.                 /* TCPFULL - tcp output buffer full */
  22.     int    u_wstate;    /* Write terminal state */
  23.                 /* NORMALMODE */
  24.                 /* URGENTM - urgent mode
  25.                    ignore nonspecial chars */
  26.     int    u_wspecial;    /* Write terminal character handling */
  27.                 /* NORMALMODE */
  28.                 /* '\r' (13), IAC, WILL, WONT, DO, DONT -
  29.                    processing special chars */
  30.     int    u_prompt;    /* Prompt char */
  31.     int    u_sendm;    /* Send mode */
  32.                 /* EVERYC - send to net on every char */
  33.                 /* NEWLINE - send to net on newline */
  34.     int    u_echom;    /* Echo mode */
  35.                 /* LOCAL - local echo */
  36.                 /* REMOTE - remote echo */
  37.     int    u_echongo;    /* Echo negotiation request outstanding */
  38.                 /* NORMALMODE */
  39.                 /* LECHOREQ - IAC DONT ECHO was sent */
  40.                 /* RECHOREQ - IAC DO ECHO was sent */
  41.     int    u_mode;        /* status line on or off flag */
  42.     int    u_ask;        /* ask about tftp transfers */
  43. };
  44.  
  45. #define NORMALMODE        0
  46. #define SPECIAL        1
  47. /*
  48. #define TEST        2
  49. */
  50. #define    CONFIRM        3
  51. #define HOLD        4
  52.  
  53. #define    TFUNKNOWN    1
  54. #define TFWAITING    2
  55. #define    TFYES        3
  56. #define    TFNO        4
  57.  
  58. #define    BLOCK        1
  59. #define NOBLOCK        2
  60. #define URGENTM        1
  61. #define EVERYC        1
  62. #define NEWLINE        2
  63. #define LOCAL        1
  64. #define REMOTE        2
  65. #define LECHOREQ    1
  66. #define RECHOREQ    2
  67.  
  68. #define TNEOR    0xef
  69. #define TNSBEND    0xf0
  70. #define TNDM    242
  71. #define TNBREAK    243
  72. #define TNINT    244
  73. #define TNAO    245
  74. #define TNAYT    246
  75. #define TNERCH    247
  76. #define TNERLN    248
  77. #define TNGA    249
  78. #define TNSB    250
  79. #define TNWILL    251
  80. #define TNWONT    252
  81. #define TNDO    253
  82. #define TNDONT    254
  83. #define TNIAC    255
  84.  
  85. /* options */
  86.  
  87. #define TNIS    0
  88. #define TNSEND    1
  89.  
  90. #define OPTBINARY         0
  91. #define OPTECHO             1
  92. #define    OPTSPGA             3
  93. #define    OPTTM             6
  94. #define OPTTERMTYPE        24
  95. #define OPTEOR            25
  96. #define OPT3270REGIME    29
  97.  
  98. #define    DFESC    '\036'        /* default escape char */
  99.  
  100. #define TELNETSOCK    23    /* Telnet well known socket no. */
  101.  
  102. extern struct ucb ucb;
  103.  
  104. /* need array of states for ucb.state? */
  105. #define CLOSING        1            
  106.  
  107.  
  108. /* new for MacTCP */
  109.  
  110.  
  111. #ifdef MACTCP
  112. /* supply defines for MacTCP version which would otherwise be in net.h */
  113.  
  114. #ifdef NOTMERGED
  115. typedef long in_name;
  116.  
  117. struct net {
  118.     long    ip_addr;
  119.     long    n_defgw;
  120. };
  121.  
  122. extern struct net thisnet;
  123. extern struct net * rnet;
  124. #endif
  125.  
  126. extern short nnrup;
  127.  
  128. /* supply defines which would otherwise be in tcp.h */
  129. extern unsigned long in_cnt;
  130. extern unsigned long out_cnt;            /* # of packets seen */
  131.  
  132. /* a structure to hold a IPaddr/TCP socket */
  133.  
  134.  
  135. #ifndef MULTI
  136. struct hostsock {
  137.     union {
  138.         char bytes[4];
  139.         unsigned long addr;
  140.     } u;
  141.     unsigned port;                /* TCP port to connect to */
  142.     short hostconnact;            /* ID of actions to execute after host connection complete */
  143. };
  144. #endif
  145.  
  146. #endif
  147. extern int vt100();
  148. extern int vt100str();
  149. extern int h19();
  150. extern int h19str();
  151.  
  152.